#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <vector>

using namespace std;

struct ListNode {
    int val;
    ListNode* next;
    ListNode(int x) : val(x), next(NULL) {}
};

class Node {
   public:
    int val;
    Node* next;
    Node* random;

    Node(int _val) {
        val = _val;
        next = NULL;
        random = NULL;
    }
};

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class Solution {
   public:
    vector<int> singleNumbers(vector<int>& nums) {
        int carry = nums[0];
        for (int i = 1; i < nums.size(); i++) {
            carry ^= nums[i];
        }
        int first_one = 0, divide_carry = 1, first_unknown = 0,
            second_unknown = 0;
        while (carry ^ 1 == 1) {
            first_one++;
            carry = carry >> 1;
        }
        while (first_one--) {
            divide_carry = divide_carry << 1;
        }
        for (int i = 0; i < nums.size(); i++) {
            if (nums[i] & divide_carry) {
                first_unknown ^= nums[i];
            } else {
                second_unknown ^= nums[i];
            }
        }
        vector<int> ret;
        ret.push_back(first_unknown);
        ret.push_back(second_unknown);
        return ret;
    }
};

int main() {
    cout << "Hello, World!";
    vector<int> tmp;
    tmp.push_back(0);
    tmp.push_back(0);
    tmp.push_back(1);
    tmp.push_back(5);
    tmp.push_back(2);
    tmp.push_back(2);
    tmp.push_back(2);
    tmp.push_back(2);
    Solution().singleNumbers(tmp);
    return 0;
}
